styleproperties: resolve properties of type GTK_TYPE_SHADOW
authorCosimo Cecchi <cosimoc@gnome.org>
Fri, 20 May 2011 20:11:41 +0000 (16:11 -0400)
committerCosimo Cecchi <cosimoc@gnome.org>
Fri, 20 May 2011 22:49:50 +0000 (18:49 -0400)
https://bugzilla.gnome.org/show_bug.cgi?id=649314

gtk/gtkstyleproperties.c

index 88467ae04e3be64738ac8b6e01e44230ddd4f0ef..9358605233849444649d33ff70f5b3408eb547b1 100644 (file)
@@ -845,6 +845,29 @@ resolve_gradient (GtkStyleProperties *props,
   return TRUE;
 }
 
+static gboolean
+resolve_shadow (GtkStyleProperties *props,
+                GValue *value)
+{
+  GtkShadow *resolved, *base;
+
+  base = g_value_get_boxed (value);
+
+  if (base == NULL)
+    return TRUE;
+  
+  if (_gtk_shadow_get_resolved (base))
+    return TRUE;
+
+  resolved = _gtk_shadow_resolve (base, props);
+  if (resolved == NULL)
+    return FALSE;
+
+  g_value_take_boxed (value, resolved);
+
+  return TRUE;
+}
+
 static gboolean
 style_properties_resolve_type (GtkStyleProperties *props,
                                PropertyNode       *node,
@@ -872,6 +895,11 @@ style_properties_resolve_type (GtkStyleProperties *props,
       if (!resolve_gradient (props, val))
         return FALSE;
     }
+  else if (val && G_VALUE_TYPE (val) == GTK_TYPE_SHADOW)
+    {
+      if (!resolve_shadow (props, val))
+        return FALSE;
+    }
 
   return TRUE;
 }